<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var date = new Date();//date日期要先实例化，也就是要new
        console.log(date.getFullYear());
        console.log(date.getMonth() + 1);//返回的月份一般会小一个月，加1就行了
        console.log(date.getMinutes());
        //案例
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var dates = date.getDate(); 
        console.log('今天是：'+year+'年'+month+'月'+dates+'日');
        console.log(dates);

    </script>
</head>
<body>
    
</body>
</html>